home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / CIncludes / PictUtils.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-11  |  5.6 KB  |  154 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        PictUtils.h
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. */
  16.  
  17. #ifndef __PICTUTILS__
  18. #define __PICTUTILS__
  19.  
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. /*    #include <ConditionalMacros.h>                                */
  25.  
  26. #ifndef __WINDOWS__
  27. #include <Windows.h>
  28. #endif
  29. /*    #include <Memory.h>                                            */
  30. /*        #include <MixedMode.h>                                    */
  31. /*    #include <Quickdraw.h>                                        */
  32. /*        #include <QuickdrawText.h>                                */
  33. /*    #include <Events.h>                                            */
  34. /*        #include <OSUtils.h>                                    */
  35. /*    #include <Controls.h>                                        */
  36. /*        #include <Menus.h>                                        */
  37.  
  38. #ifndef __PALETTES__
  39. #include <Palettes.h>
  40. #endif
  41.  
  42. #ifdef __cplusplus
  43. extern "C" {
  44. #endif
  45.  
  46. #if GENERATINGPOWERPC
  47. #pragma options align=mac68k
  48. #endif
  49.  
  50. #ifdef __CFM68K__
  51. #pragma lib_export on
  52. #endif
  53.  
  54.  
  55. enum {
  56.     returnColorTable            = 0x0001,
  57.     returnPalette                = 0x0002,
  58.     recordComments                = 0x0004,
  59.     recordFontInfo                = 0x0008,
  60.     suppressBlackAndWhite        = 0x0010
  61. };
  62.  
  63. enum {
  64. /* color pick methods */
  65.     systemMethod                = 0,                            /* system color pick method */
  66.     popularMethod                = 1,                            /* method that chooses the most popular set of colors */
  67.     medianMethod                = 2,                            /* method that chooses a good average mix of colors */
  68. /* color bank types */
  69.     ColorBankIsCustom            = -1,
  70.     ColorBankIsExactAnd555        = 0,
  71.     ColorBankIs555                = 1
  72. };
  73.  
  74. typedef long PictInfoID;
  75.  
  76. struct CommentSpec {
  77.     short                            count;                        /* number of occurrances of this comment ID */
  78.     short                            ID;                            /* ID for the comment in the picture */
  79. };
  80. typedef struct CommentSpec CommentSpec, *CommentSpecPtr, **CommentSpecHandle;
  81.  
  82. struct FontSpec {
  83.     short                            pictFontID;                    /* ID of the font in the picture */
  84.     short                            sysFontID;                    /* ID of the same font in the current system file */
  85.     long                            size[4];                    /* bit array of all the sizes found (1..127) (bit 0 means > 127) */
  86.     short                            style;                        /* combined style of all occurrances of the font */
  87.     long                            nameOffset;                    /* offset into the fontNamesHdl handle for the font’s name */
  88. };
  89. typedef struct FontSpec FontSpec, *FontSpecPtr, **FontSpecHandle;
  90.  
  91. struct PictInfo {
  92.     short                            version;                    /* this is always zero, for now */
  93.     long                            uniqueColors;                /* the number of actual colors in the picture(s)/pixmap(s) */
  94.     PaletteHandle                    thePalette;                    /* handle to the palette information */
  95.     CTabHandle                        theColorTable;                /* handle to the color table */
  96.     Fixed                            hRes;                        /* maximum horizontal resolution for all the pixmaps */
  97.     Fixed                            vRes;                        /* maximum vertical resolution for all the pixmaps */
  98.     short                            depth;                        /* maximum depth for all the pixmaps (in the picture) */
  99.     Rect                            sourceRect;                    /* the picture frame rectangle (this contains the entire picture) */
  100.     long                            textCount;                    /* total number of text strings in the picture */
  101.     long                            lineCount;                    /* total number of lines in the picture */
  102.     long                            rectCount;                    /* total number of rectangles in the picture */
  103.     long                            rRectCount;                    /* total number of round rectangles in the picture */
  104.     long                            ovalCount;                    /* total number of ovals in the picture */
  105.     long                            arcCount;                    /* total number of arcs in the picture */
  106.     long                            polyCount;                    /* total number of polygons in the picture */
  107.     long                            regionCount;                /* total number of regions in the picture */
  108.     long                            bitMapCount;                /* total number of bitmaps in the picture */
  109.     long                            pixMapCount;                /* total number of pixmaps in the picture */
  110.     long                            commentCount;                /* total number of comments in the picture */
  111.     long                            uniqueComments;                /* the number of unique comments in the picture */
  112.     CommentSpecHandle                commentHandle;                /* handle to all the comment information */
  113.     long                            uniqueFonts;                /* the number of unique fonts in the picture */
  114.     FontSpecHandle                    fontHandle;                    /* handle to the FontSpec information */
  115.     Handle                            fontNamesHandle;            /* handle to the font names */
  116.     long                            reserved1;
  117.     long                            reserved2;
  118. };
  119. typedef struct PictInfo PictInfo;
  120.  
  121. typedef PictInfo *PictInfoPtr, **PictInfoHandle;
  122.  
  123. extern pascal OSErr GetPictInfo(PicHandle thePictHandle, PictInfo *thePictInfo, short verb, short colorsRequested, short colorPickMethod, short version)
  124.  THREEWORDINLINE(0x303C, 0x0800, 0xA831);
  125. extern pascal OSErr GetPixMapInfo(PixMapHandle thePixMapHandle, PictInfo *thePictInfo, short verb, short colorsRequested, short colorPickMethod, short version)
  126.  THREEWORDINLINE(0x303C, 0x0801, 0xA831);
  127. extern pascal OSErr NewPictInfo(PictInfoID *thePictInfoID, short verb, short colorsRequested, short colorPickMethod, short version)
  128.  THREEWORDINLINE(0x303C, 0x0602, 0xA831);
  129. extern pascal OSErr RecordPictInfo(PictInfoID thePictInfoID, PicHandle thePictHandle)
  130.  THREEWORDINLINE(0x303C, 0x0403, 0xA831);
  131. extern pascal OSErr RecordPixMapInfo(PictInfoID thePictInfoID, PixMapHandle thePixMapHandle)
  132.  THREEWORDINLINE(0x303C, 0x0404, 0xA831);
  133. extern pascal OSErr RetrievePictInfo(PictInfoID thePictInfoID, PictInfo *thePictInfo, short colorsRequested)
  134.  THREEWORDINLINE(0x303C, 0x0505, 0xA831);
  135. extern pascal OSErr DisposePictInfo(PictInfoID thePictInfoID)
  136.  THREEWORDINLINE(0x303C, 0x0206, 0xA831);
  137. #if OLDROUTINENAMES
  138. #define DisposPictInfo(thePictInfoID) DisposePictInfo(thePictInfoID)
  139. #endif
  140.  
  141. #ifdef __CFM68K__
  142. #pragma lib_export off
  143. #endif
  144.  
  145. #if GENERATINGPOWERPC
  146. #pragma options align=reset
  147. #endif
  148.  
  149. #ifdef __cplusplus
  150. }
  151. #endif
  152.  
  153. #endif /* __PICTUTILS__ */
  154.